<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		//数组去重方法一
		var arr1=[1,2,2,6,4,4,7,8,9,3,3,4,7,7,7,7,7,7,7];
		var arr2=[];
		for(var i=0;i<arr1.length;i++){
			if(arr2.indexOf(arr1[i])==-1){
				arr2.push(arr1[i])
			}
		}
//		console.log(arr2);
		//数组去重方法二
		var arr1=[1,2,2,6,4,4,7,8,9,3,3,4,7,7,7,7,7,7,7,65];
		arr1.sort(function(a,b){
			return a-b;
		});
		var arr2=[arr1[0]];
		for(var i=0;i<arr1.length;i++){
			if(arr1[i]!==arr2[arr2.length-1]){
				arr2.push(arr1[i])
			}
		}
		console.log(arr2)
	</script>
</html>
